﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainPopUp.master" AutoEventWireup="true"
    CodeFile="CreateUseCase.aspx.cs" Inherits="PopUp_CreateUseCase" Theme="Main" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphcphSemiCASEPopUp" runat="Server">
    <table class="AnaTablo" style="width: 100%">
        <tr>
            <th id="ThBaslik" runat="server" class="ThBaslikRenk1">
            </th>
        </tr>
        <tr>
            <td>
                <table>
                    <tr>
                        <td colspan="2">
                            <asp:RadioButton ID="RadioButtonFunctionalReq" runat="server" Text="Functional Requirement"
                                Checked="true" OnCheckedChanged="RadioButtonFunctionalReq_CheckedChanged" GroupName="Func"
                                AutoPostBack="true" />
                            <asp:RadioButton ID="RadioButtonNonFunctional" runat="server" Text="Nonfunctional Requirement"
                                OnCheckedChanged="RadioButtonNonFunctional_CheckedChanged" GroupName="Func" AutoPostBack="true" />
                        </td>
                    </tr>
                </table>
                <table>
                    <tr>
                        <td class="TdRenkSol" style="width: 25%">
                            Use Case Name:
                        </td>
                        <td>
                            <SemiCASE:GenelTextBox ID="GenelTextBoxUseCaseName" runat="server" Width="596" uciZorunlu="true"
                                ValidationGroup="UC" />
                        </td>
                    </tr>
                </table>
                <table id="TableFunctional" runat="server">
                    <tr>
                        <td class="TdRenkSol">
                            Scope:
                        </td>
                        <td>
                            <SemiCASE:GenelTextBox ID="GenelTextBoxScope" runat="server" Width="596" uciZorunlu="true"
                                ValidationGroup="UC" />
                        </td>
                    </tr>
                    <tr>
                        <td class="TdRenkSol">
                            Level:
                        </td>
                        <td>
                            <SemiCASE:GenelTextBox ID="GenelTextBoxLevel" runat="server" Width="596" />
                        </td>
                    </tr>
                    <tr>
                        <td class="TdRenkSol">
                            Primary Actor:
                        </td>
                        <td>
                            <SemiCASE:GenelTextBox ID="GenelTextBoxPrimaryActor" runat="server" Width="596" uciZorunlu="true"
                                ValidationGroup="UC" />
                        </td>
                    </tr>
                    <tr>
                        <td class="TdRenkSol">
                            Stakeholders - Interests:
                        </td>
                        <td>
                            <SemiCASE:GenelTextBox ID="GenelTextBoxStakeHolders" runat="server" Width="596" TextMode="MultiLine"
                                Height="50" />
                        </td>
                    </tr>
                    <tr>
                        <td class="TdRenkSol">
                            Preconditions:
                        </td>
                        <td>
                            <SemiCASE:GenelTextBox ID="GenelTextBoxPreconditions" runat="server" Width="596"
                                TextMode="MultiLine" Height="50" />
                        </td>
                    </tr>
                    <tr>
                        <td class="TdRenkSol">
                            Success Guarantees:
                        </td>
                        <td>
                            <SemiCASE:GenelTextBox ID="GenelTextBoxSuccessGuarantees" runat="server" Width="596"
                                uciZorunlu="true" ValidationGroup="UC" />
                        </td>
                    </tr>
                    <tr>
                        <td class="TdRenkSol">
                            Special Requirements:
                        </td>
                        <td>
                            <SemiCASE:GenelTextBox ID="GenelTextBoxSpecialRequirements" runat="server" Width="596"
                                TextMode="MultiLine" Height="50" />
                        </td>
                    </tr>
                    <tr>
                        <td class="TdRenkSol">
                            Technology and Data Var. List
                        </td>
                        <td>
                            <SemiCASE:GenelTextBox ID="GenelTextBoxTechnology" runat="server" Width="596" />
                        </td>
                    </tr>
                    <tr>
                        <td class="TdRenkSol">
                            Frequency of Occurence:
                        </td>
                        <td>
                            <SemiCASE:GenelTextBox ID="GenelTextBoxFrequency" runat="server" Width="596" />
                        </td>
                    </tr>
                    <tr>
                        <td class="TdRenkSol">
                            Miscellaneaous:
                        </td>
                        <td>
                            <SemiCASE:GenelTextBox ID="GenelTextBoxMisc" runat="server" Width="596" />
                        </td>
                    </tr>
                    <tr>
                        <td class="TdRenkSol">
                            Status:
                        </td>
                        <td>
                            <asp:DropDownList ID="DropDownListStatus" runat="server" DataValueField="StatusID"
                                DataTextField="StatusName">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="TdRenkSol">
                            Priority:
                        </td>
                        <td>
                            <asp:DropDownList ID="DropDownListPriority" runat="server">
                                <asp:ListItem Text="Select Priority" Value="0"></asp:ListItem>
                                <asp:ListItem Text="HIGH" Value="HIGH"></asp:ListItem>
                                <asp:ListItem Text="MEDIUM" Value="MEDIUM"></asp:ListItem>
                                <asp:ListItem Text="LOW" Value="LOW"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="TdRenkSol">
                            Main Success Scenario Steps:
                        </td>
                        <td style="padding: 0px">
                            <asp:UpdatePanel ID="UpdatePanelMSS" runat="server">
                                <ContentTemplate>
                                    <SemiCASE:GenelTextBox ID="GenelTextBoxMSS" runat="server" Width="500" />
                                    <asp:LinkButton ID="LinkButtonAddMSS" runat="server" Text="AddMSS" OnClick="LinkButtonAddMSS_Click"></asp:LinkButton>
                                    <br />
                                    <asp:Label ID="LabelUyari" runat="server" ForeColor="Red"></asp:Label>
                                    <asp:GridView ID="gvMSS" runat="server" AutoGenerateColumns="False" Width="600" DataKeyNames="MssID,SiraNo"
                                        EmptyDataText="There is no main success scenario." OnRowCommand="gvMSS_RowCommand"
                                        OnRowDataBound="gvMSS_RowDataBound" AllowPaging="false" OnRowEditing="gvMSS_RowEditing"
                                        OnRowCancelingEdit="gvMSS_RowCancelingEdit" OnRowUpdating=" gvMSS_RowUpdating">
                                        <Columns>
                                            <asp:BoundField DataField="SiraNo" HeaderText="" ItemStyle-CssClass="columnborder"
                                                ItemStyle-HorizontalAlign="Center" ItemStyle-Width="3%" ReadOnly="true" />
                                            <asp:BoundField DataField="Name" HeaderText="Mss" ItemStyle-CssClass="columnborder" />
                                            <asp:CommandField CancelText="Cancel" ShowEditButton="True" ShowHeader="True" ShowCancelButton="true"
                                                ShowDeleteButton="false" EditText="Edit" InsertText="Ekle" UpdateText="Update"
                                                ItemStyle-CssClass="columnborder" ItemStyle-Width="5%" InsertVisible="False">
                                                <ItemStyle CssClass="columnborder" Width="5%" />
                                            </asp:CommandField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="ButtonDelete" runat="server" ToolTip="Delete" Text="Delete" CommandArgument='<%# Eval("MssID") %>'
                                                        CommandName="DeleteMSS" OnClientClick="javascript:return confirm('MSS will be deleted. Are you sure?')" />
                                                </ItemTemplate>
                                                <ItemStyle Width="3%" HorizontalAlign="Center" CssClass="columnborder" />
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="ButtonAddExtention" runat="server" Text="AddExtention" CommandArgument='<%# Eval("MssID") %>'
                                                        CommandName="AddExtention" />
                                                </ItemTemplate>
                                                <ItemStyle Width="15%" HorizontalAlign="Center" CssClass="columnborder" />
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="ButtonUp" runat="server" Text="Up" CommandArgument='<%# Eval("SiraNo") %>'
                                                        CommandName="UpMss" />
                                                    <asp:LinkButton ID="ButtonDown" runat="server" Text="Down" CommandArgument='<%# Eval("SiraNo") %>'
                                                        CommandName="DownMss" />
                                                </ItemTemplate>
                                                <ItemStyle Width="15%" HorizontalAlign="Center" CssClass="columnborder" />
                                            </asp:TemplateField>
                                        </Columns>
                                        <EmptyDataRowStyle Font-Bold="True" ForeColor="Red" />
                                    </asp:GridView>
                                    <asp:HiddenField ID="HiddenFieldMSSID" runat="server" />
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td class="TdRenkSol">
                            Extentions:
                        </td>
                        <td>
                            <asp:UpdatePanel ID="UpdatePanelExtention" runat="server">
                                <ContentTemplate>
                                    <asp:LinkButton ID="LinkButttonAddExtention" runat="server" Text="Add Extention"></asp:LinkButton>
                                    <asp:GridView ID="gvExtention" runat="server" AutoGenerateColumns="False" Width="600"
                                        DataKeyNames="ExtentionID" EmptyDataText="There is no extention." OnRowCommand="gvExtention_RowCommand"
                                        AllowPaging="false" OnRowDataBound="gvExtention_RowDataBound" OnRowEditing="gvExtention_RowEditing"
                                        OnRowCancelingEdit="gvExtention_RowCancelingEdit" OnRowUpdating="gvExtention_RowUpdating">
                                        <Columns>
                                            <asp:BoundField DataField="SiraNo" HeaderText="" ItemStyle-CssClass="columnborder"
                                                ItemStyle-HorizontalAlign="Center" ItemStyle-Width="3%" Visible="false" ReadOnly="true" />
                                            <asp:BoundField DataField="MssSiraNo" HeaderText="" ItemStyle-CssClass="columnborder"
                                                ItemStyle-HorizontalAlign="Center" ItemStyle-Width="3%" ReadOnly="true" />
                                            <asp:BoundField DataField="OrderSign" HeaderText="" ItemStyle-CssClass="columnborder"
                                                ItemStyle-HorizontalAlign="Center" ItemStyle-Width="3%" ReadOnly="true" />
                                            <asp:TemplateField>
                                                <HeaderTemplate>
                                                    Extention
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="LabelExtentionName" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                                                    <br />
                                                    <br />
                                                    <asp:GridView ID="gvExtentionStep" runat="server" AutoGenerateColumns="False" Width="100%"
                                                        DataKeyNames="StepID" OnRowCommand="gvExtentionStep_RowCommand" AllowPaging="false"
                                                        OnRowEditing="gvExtentionStep_RowEditing" OnRowCancelingEdit="gvExtentionStep_RowCancelingEdit"
                                                        OnRowUpdating="gvExtentionStep_RowUpdating">
                                                        <Columns>
                                                            <asp:BoundField DataField="SiraNo" HeaderText="" ItemStyle-CssClass="columnborder"
                                                                ItemStyle-HorizontalAlign="Center" ItemStyle-Width="3%" ReadOnly="true" />
                                                            <asp:BoundField DataField="StepName" HeaderText="Step" ItemStyle-CssClass="columnborder"
                                                                ItemStyle-HorizontalAlign="Left" />
                                                            <asp:TemplateField>
                                                                <ItemTemplate>
                                                                    <asp:LinkButton ID="ButtonDelete" runat="server" Text="Delete" CommandArgument='<%# Eval("StepID") %>'
                                                                        CommandName="DeleteStep" OnClientClick="javascript:return confirm('Extention step will be deleted. Are you sure?')" />
                                                                </ItemTemplate>
                                                                <ItemStyle Width="3%" HorizontalAlign="Center" CssClass="columnborder" />
                                                            </asp:TemplateField>
                                                        </Columns>
                                                    </asp:GridView>
                                                </ItemTemplate>
                                                <ItemStyle CssClass="columnborder" />
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBoxExtention" runat="server" Width="95%" Text='<%#Eval("Name") %>'></asp:TextBox>
                                                    <br />
                                                    <br />
                                                    <asp:GridView ID="gvExtentionStep" runat="server" AutoGenerateColumns="False" Width="100%"
                                                        DataKeyNames="StepID" OnRowCommand="gvExtentionStep_RowCommand" AllowPaging="false">
                                                        <Columns>
                                                            <asp:BoundField DataField="SiraNo" HeaderText="" ItemStyle-CssClass="columnborder"
                                                                ItemStyle-HorizontalAlign="Center" ItemStyle-Width="3%" ReadOnly="true" />
                                                            <asp:BoundField DataField="StepName" HeaderText="Step" ItemStyle-CssClass="columnborder"
                                                                ItemStyle-HorizontalAlign="Left" />
                                                            <asp:TemplateField>
                                                                <ItemTemplate>
                                                                    <asp:LinkButton ID="ButtonDelete" runat="server" Text="Delete" CommandArgument='<%# Eval("StepID") %>'
                                                                        CommandName="DeleteStep" OnClientClick="javascript:return confirm('Extention step will be deleted. Are you sure?')" />
                                                                </ItemTemplate>
                                                                <ItemStyle Width="3%" HorizontalAlign="Center" CssClass="columnborder" />
                                                            </asp:TemplateField>
                                                        </Columns>
                                                    </asp:GridView>
                                                </EditItemTemplate>
                                            </asp:TemplateField>
                                            <asp:CommandField CancelText="Cancel" ShowEditButton="True" ShowHeader="True" ShowCancelButton="true"
                                                ShowDeleteButton="false" EditText="Edit" InsertText="Ekle" UpdateText="Update"
                                                ItemStyle-CssClass="columnborder" ItemStyle-Width="5%" InsertVisible="False">
                                                <ItemStyle CssClass="columnborder" Width="5%" />
                                            </asp:CommandField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="ButtonDelete" runat="server" Text="Delete" CommandArgument='<%# Eval("ExtentionID") %>'
                                                        CommandName="DeleteExtention" OnClientClick="javascript:return confirm('Extention will be deleted. Are you sure?')" />
                                                </ItemTemplate>
                                                <ItemStyle Width="3%" HorizontalAlign="Center" CssClass="columnborder" />
                                            </asp:TemplateField>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="ButtonAddExtention" runat="server" Text="Add Step" CommandArgument='<%# Eval("ExtentionID") %>'
                                                        CommandName="AddStep" />
                                                </ItemTemplate>
                                                <ItemStyle Width="13%" HorizontalAlign="Center" CssClass="columnborder" />
                                            </asp:TemplateField>
                                        </Columns>
                                        <EmptyDataRowStyle Font-Bold="True" ForeColor="Red" />
                                    </asp:GridView>
                                    <ajt:ModalPopupExtender ID="MPE" runat="server" TargetControlID="LinkButttonAddExtention"
                                        PopupControlID="PanelAddExtension" BackgroundCssClass="ModalPopupBackground"
                                        DropShadow="true" CancelControlID="LinkButtonCancel" />
                                    <asp:Panel ID="PanelAddExtension" runat="server" Width="425">
                                        <table class="AnaTablo">
                                            <tr>
                                                <td class="TdRenkSol">
                                                    Extension:
                                                </td>
                                                <td>
                                                    <SemiCASE:GenelTextBox ID="GenelTextBoxExtention" runat="server" Width="350" TextMode="MultiLine"
                                                        Height="30" />
                                                    <asp:Label ID="LabelUyariEx" runat="server" ForeColor="Red"></asp:Label>
                                                </td>
                                            </tr>
                                            <tr style="text-align: center">
                                                <td colspan="2">
                                                    <asp:LinkButton ID="LinkButtonAddExt" runat="server" Text="Add Extention" OnClick="LinkButtonAddExtention_Click"></asp:LinkButton>
                                                    <asp:LinkButton ID="LinkButtonCancel" runat="server" Text="Cancel"></asp:LinkButton>
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                    <asp:LinkButton ID="LinkButtonAddStep" runat="server" Text="Add Extention" Style="display: none"></asp:LinkButton>
                                    <asp:HiddenField ID="HiddenFieldExtentionID" runat="server" />
                                    <ajt:ModalPopupExtender ID="MPES" runat="server" TargetControlID="LinkButtonAddStep"
                                        PopupControlID="PanelAddStep" BackgroundCssClass="ModalPopupBackground" DropShadow="true"
                                        CancelControlID="LinkButtonStepIptal" />
                                    <asp:Panel ID="PanelAddStep" runat="server" Width="405">
                                        <table class="AnaTablo">
                                            <tr>
                                                <td class="TdRenkSol">
                                                    Step:
                                                </td>
                                                <td>
                                                    <SemiCASE:GenelTextBox ID="GenelTextBoxStep" runat="server" Width="350" TextMode="MultiLine"
                                                        Height="30" />
                                                    <asp:Label ID="Label1" runat="server" ForeColor="Red"></asp:Label>
                                                </td>
                                            </tr>
                                            <tr style="text-align: center">
                                                <td colspan="2">
                                                    <asp:LinkButton ID="LinkButtonStepKaydet" runat="server" Text="Add Step" OnClick="LinkButtonAddStep_Click"></asp:LinkButton>
                                                    <asp:LinkButton ID="LinkButtonStepIptal" runat="server" Text="Cancel"></asp:LinkButton>
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style="text-align: center">
                <asp:Button ID="ButtonSave" runat="server" SkinID="ButtonKaydet" OnClick="ButtonSave_Click"
                    ValidationGroup="UC" />
            </td>
        </tr>
    </table>
</asp:Content>
